FROM node:14-alpine AS build
WORKDIR /app
COPY package.json yarn.lock /app/
RUN yarn install
COPY . .
RUN yarn build

FROM node:14-alpine AS prod
WORKDIR /app
COPY --from=build /app/config.json .
COPY --from=build /app/package.json /app/
COPY --from=build /app/node_modules /app/node_modules
COPY --from=build /app/build /app/build
EXPOSE 12386
CMD [ "yarn", "start" ]
